package com.aaa.config;

import java.time.LocalDateTime;
import java.util.UUID;

/**
 * @Classname b
 * @Description TODO
 * @Date 2020/12/2 14:56
 * @Created by 腾飞
 * @describe    随机生成唯一 code
 */
public class RandomNumberUtils {

    public static String getRandomString(){
        StringBuilder sb = new StringBuilder();
        sb.append(LocalDateTime.now().getYear());
        int month = LocalDateTime.now().getMonth().getValue();
        sb.append(month>=10?month:'0'+month);
        sb.append(LocalDateTime.now().getDayOfMonth());
        sb.append(Math.abs(UUID.randomUUID().getLeastSignificantBits()%1_00_00_000_000L));
        return sb.toString();
    }
}
